package android.mystyle.phonebook;

import android.app.TabActivity;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.provider.Contacts.Intents.UI;
import android.view.Window;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class MSPhonebook extends TabActivity implements TabHost.OnTabChangeListener
{
	
	TabHost mTabHost;
	
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		
		setContentView(R.layout.ms_phonebook);
				
		mTabHost = getTabHost();
		mTabHost.setOnTabChangedListener(this);
		
		initTab();
		
	}

	@Override
	public void onTabChanged(String arg0)
	{
		// TODO Auto-generated method stub
		
	}
	
	@SuppressWarnings("deprecation")
	private void initTab()
	{
        Intent intent_Phonebook = new Intent(UI.LIST_DEFAULT);
        intent_Phonebook.setClass(this, Act_PhonebookList.class);
		Drawable icon_Phonebook = this.getResources().getDrawable(R.drawable.ic_folder_contacts_48);
		
		mTabHost.addTab(mTabHost.newTabSpec("tagPhonebook").setIndicator("Phonebook", icon_Phonebook).setContent(intent_Phonebook));
		

		Intent intent_Favorite = new Intent(UI.LIST_DEFAULT);
		intent_Favorite.setClass(this, Act_FavoriteList.class);
		Drawable icon_Favorite = this.getResources().getDrawable(R.drawable.ic_folder_favorite_48);
		
		mTabHost.addTab(mTabHost.newTabSpec("tagFavorite").setIndicator("Favorite", icon_Favorite).setContent(intent_Favorite));


		
	}

}